<template>
  <div class="home-page">
    <div class="game-container">
      <h1 class="game-title">ROS 车辆控制游戏</h1>
      <div class="mode-selection">
        <div class="mode-card" @click="selectMode('test')">
          <div class="mode-icon">🧪</div>
          <h2>测试模式</h2>
          <p>练习基本操作，熟悉车辆控制</p>
        </div>
        <div class="mode-card" @click="selectMode('game')">
          <div class="mode-icon">🎮</div>
          <h2>游戏模式</h2>
          <p>挑战任务，体验完整游戏</p>
        </div>
        <div class="mode-card" @click="selectMode('control')">
          <div class="mode-icon">📹</div>
          <h2>操控模式</h2>
          <p>实时图像流，远程车辆控制</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomePage',
  methods: {
    selectMode(mode) {
      if (mode === 'test') {
        this.$router.push('/test')
      } else if (mode === 'game') {
        this.$router.push('/game')
      } else if (mode === 'control') {
        this.$router.push('/control')
      }
    }
  }
}
</script>

<style scoped>
.home-page {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.game-container {
  text-align: center;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.game-title {
  color: white;
  font-size: 3rem;
  margin-bottom: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: bold;
}

.mode-selection {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.mode-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  width: 280px;
  height: 200px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mode-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: #667eea;
}

.mode-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.mode-card h2 {
  color: #333;
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  font-weight: bold;
  line-height: 1.2;
}

.mode-card p {
  color: #666;
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .home-page {
    padding: 15px;
  }
  
  .game-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .mode-selection {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  
  .mode-card {
    width: 100%;
    max-width: 300px;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .home-page {
    padding: 10px;
  }
  
  .game-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .mode-card {
    padding: 1.5rem;
    max-width: 280px;
    height: 160px;
  }
}
</style>